<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>发短信</title>
<style type="text/css">
    .l-table-edit {font-size: 12px;margin: auto; width:100%; border-collapse:collapse;}
 	.l-table-edit td{ padding:4px;border:1px solid #336699;}
</style>
</head>

	<table  class="l-table-edit">
		<tr>
			<td > 方式</td>
			<td >  内容   </td>
			<td > 操作</td>
		</tr>
		<tr>
			<td width=20%>默认内容 </td>
			<td width=57%>
			
					<c:forEach items="${templateList}" var="list" varStatus="status">
						<div style="width: 500px">
					     	<input type="radio" name="RadioGroup1" value="${list.source}" id="RadioGroup1_0" />${list.source}<br>
					     </div>
					</c:forEach>
				
		   </td>
			<td width=23%> <input type="button" value="发送短信" id="mrMsg" onclick="sendMsgMr();"/></td>
		</tr>
		<tr>
			<td >自定义内容 </td>
			<td > <textarea rows="" cols="" style="width: 550px;height: 80px;" id="msgText"></textarea>  </td>
			<td > <input type="button" value="发送短信" id="zdyMsg" onclick="sendMsgZdy();"/></td>
		</tr>
	</table>
		
	<script type="text/javascript">
		
	function sendMsgZdy(){
		$.ligerDialog.confirm('你确定发送短信吗？', 
				function (yes){
					if(yes){
						$.post("/misc/order/sendMsgMr.htm",{content:$("#msgText").val(),phone:${phone}},
								function(data){
									alert("发送成功！")
								}
							); 
					}
				})
	}
	function sendMsgMr(){
		$.ligerDialog.confirm('你确定发送短信吗？', 
				function (yes){
					if(yes){
						var content =$(":radio[name='RadioGroup1'][checked]").val();
						$.post("/misc/order/sendMsgMr.htm",{content:content,phone:${phone}},
								function(data){
									alert("发送成功！")
								}
							); 
					}
				})
	}
	</script>